﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace System.Text.Parsing
{
    /// <summary>Provides methods for retrieval of grammar processors.</summary>
    public static class GrammarProcessors
    {
        /// <summary>Creates a <see cref="GrammarTokenizerProcessor"/> object from specified implementation name.</summary>
        /// <param name="implementation">The name of the implementation.</param>
        /// <returns>A <see cref="GrammarTokenizerProcessor"/> object, or a null reference if no processor found for specified implementation.</returns>
        public static GrammarTokenizerProcessor CreateTokenizerProcessor(string implementation)
        {
            if (implementation == null) throw new ArgumentNullException("implementation");
            switch (implementation)
            {
                case "RegexTextTokenizer": return new RegexTextTokenizerGrammarProcessor();
                default: return null;
            }
        }
    }
}
